package com.py.korona.db.model;

import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import com.py.korona.db.UriBuilder;
import com.py.korona.db.model.base.Entity;
import com.py.korona.db.model.base.EntityDescription;
import com.py.korona.db.model.base.EntityProperty;

public class GeopointsInRoom extends Entity {
    public static String             FieldNameGeopoint = "geopoint";
    public static String             FieldNameID       = "_id";
    public static String             FieldNameRoom     = "room";
    public static String             Table             = "geopointsinroom";
    private static EntityDescription entityDescription_;
    private long                     geopoint;
    private long                     room;

    public static String entityTableName() {
        return GeopointsInRoom.Table;
    }

    public static EntityDescription entityDescription() {
        if (null == entityDescription_) {
            entityDescription_ = new EntityDescription();
            entityDescription_.addProperty(new EntityProperty(GeopointsInRoom.FieldNameID, "integer", null, "primary key autoincrement"));
            entityDescription_.addProperty(new EntityProperty(GeopointsInRoom.FieldNameRoom, "integer", null, "not null"));
            entityDescription_.addProperty(new EntityProperty(GeopointsInRoom.FieldNameGeopoint, "integer", null, "not null"));
        }
        return entityDescription_;
    }

    public static String uriAuthority() {
        return "GeopointsInRoomContentProvider";
    }

    public static String uriBasePath() {
        return "geopointsinroom";
    }

    public long getGeopoint() {
        return geopoint;
    }

    public void setGeopoint(long geopoint) {
        this.geopoint = geopoint;
    }

    public long getRoom() {
        return room;
    }

    public void setRoom(long room) {
        this.room = room;
    }

    @Override
    protected ContentValues contentValues() {
        ContentValues contentValues = new ContentValues();
        contentValues.put(GeopointsInRoom.FieldNameRoom, this.getRoom());
        contentValues.put(GeopointsInRoom.FieldNameGeopoint, this.getGeopoint());
        return contentValues;
    }

    @Override
    protected Uri objectsListUri() {
        return UriBuilder.objectListUri(GeopointsInRoom.uriAuthority(), GeopointsInRoom.uriBasePath());
    }

    @Override
    protected void onDataChanged(Cursor cursor) {
    }
}
